<%@ include file="../../common/includes/include-taglibs.jsp" %>

<html>
<head>
   <title>Poker statictis</title>
   <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
   <META HTTP-EQUIV="Cache-Control" CONTENT="max-age=0">
   <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
   <meta http-equiv="expires" content="0">
   <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
   <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
   <base href="<%=request.getContextPath()%>"/>
   <%--<link rel="stylesheet" type="text/css" src="<%=request.getContextPath()%>/poker-views/css/poker.css"/>--%>
   <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/poker-views/css/poker.css"
         media="screen"/>

</head>
<body>
<div class="stats-overview" id="stats-overview">
   <h1>Poker stats</h1>
   Number of cards per deal:
   <c:out value="${pokerStatsResult.cardsDealed}"/>
   <br/>
   Times dealed:
   <c:out value="${pokerStatsResult.turns}"/>
   <br/>
   <table border="3">
      <tr>
         <th>Rank</th>
         <th>count</th>
         <th>%</th>
         <th>probability</th>
         <th>probability %</th>
      </tr>
      <c:forEach items="${pokerStatsResult.rankCounter}" var="rankCounter">
         <tr>
            <td>
               <c:out value="${rankCounter.rank}"/>
            </td>
            <td>
               <c:out value="${rankCounter.count}"/>
            </td>
            <td>
               <c:out value="${rankCounter.percentage}"/>
            </td>
            <td>
               <c:out value="${rankCounter.probability}"/>
            </td>
            <td>
               <c:out value="${rankCounter.probabilityPercentage}"/>
            </td>
         </tr>
      </c:forEach>
   </table>
</div>

<div class="stats-form" id="stats-form">
   <form action="<%=request.getContextPath()%>/poker/stats" method="get">
      <input type="text" name="turns" value="1000"/>games played<br/>
      <input type="text" name="cards-to-deal" value="7"/>total amount of cards dealed<br/>
      <input type="submit" value="calculate"/>
   </form>
</div>
</body>
</html>